export const constantRoute = [
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'Login',
    meta: {
      title: '登录', //菜单标题
      hidden: true, //代表路由标题在菜单中是否隐藏  true:隐藏 false:不隐藏
      icon: 'Promotion',
    },
  },
  {
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: '/',
    meta: {
      title: '',
      hidden: false,
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '首页',
          hidden: false,
          icon: 'HomeFilled',
        },
      },
    ],
  },
  {
    path: '/user',
    component: () => import('@/layout/index.vue'),
    name: 'user',
    meta: {
      title: '',
      hidden: false,
    },
    redirect: '/user',
    children: [
      {
        path: '/user',
        component: () => import('@/views/user/index.vue'),
        name: 'User',
        meta: {
          title: '个人中心',
          hidden: true,
        },
      },
    ],
  },

  {
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404',
    meta: {
      title: '找不到数据',
      hidden: true,
    },
  },
  {
    path: '/screen',
    component: () => import('@/views/screen/index.vue'),
    name: 'Screen',
    meta: {
      hidden: false,
      title: '数据大屏',
      icon: 'Platform',
    },
  },
  {
    path: '/project',
    component: () => import('@/layout/index.vue'),
    name: 'Project',
    meta: {
      title: '权限管理',
      icon: 'Lock',
    },
    redirect: '/project/user',
    children: [
      {
        path: '/project/user',
        component: () => import('@/views/project/user/index.vue'),
        name: 'User',
        meta: {
          title: '用户管理',
          icon: 'User',
        },
      },
      {
        path: '/project/role',
        component: () => import('@/views/project/role/index.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          icon: 'UserFilled',
        },
      },
      {
        path: '/project/menus',
        component: () => import('@/views/project/menus/index.vue'),
        name: 'Menus',
        meta: {
          title: '菜单管理',
          icon: 'Monitor',
        },
      },
    ],
  },
  {
    path: '/hooks',
    component: () => import('@/layout/index.vue'),
    name: 'Hooks',
    meta: {
      title: 'Hooks管理',
      icon: 'Notebook',
    },
    redirect: '/hooks/date',
    children: [
      {
        path: '/hooks/date',
        component: () => import('@/views/hooks/useDate/index.vue'),
        name: 'UseDate',
        meta: {
          title: '格式化时间',
          icon: 'SetUp',
        },
      },
      {
        path: '/hooks/debounce',
        component: () => import('@/views/hooks/useDebounce/index.vue'),
        name: 'Debounce',
        meta: {
          title: '防抖',
          icon: 'SetUp',
        },
      },
      {
        path: '/hooks/throttle',
        component: () => import('@/views/hooks/useThrottle/index.vue'),
        name: 'Throttle',
        meta: {
          title: '节流',
          icon: 'SetUp',
        },
      },
    ],
  },
]

export const asyncRoute = []

//任意路由
export const anyRoute = {
  //任意路由
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  name: 'Any',
  meta: {
    title: '任意路由',
    hidden: true,
    icon: 'DataLine',
  },
}
